<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" id="i1" />
		<input type="button" id="submit" pattern="[A-Za-z]{3}" disabled="disabled" value="提交"/>
		<input type="hidden" name="" id="" value="111" />
		<script type="text/javascript">
			var i1=document.querySelector("#i1");
			var sb=document.querySelector("#submit");
			 i1.oninput=function(){
				 var reg=/[A-Za-z]{3}$/g;
				 if(reg.test(this.value)){
					 sb.disabled=false;
				 }else sb.disabled=true;
			 }
		</script>
	</body>
</html>
